package com.yuhuofei2021.spring.boot.weather.controller;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.yuhuofei2021.spring.boot.weather.entity.City;
import com.yuhuofei2021.spring.boot.weather.service.CityDataService;

/**
 * @description 城市API子服务，提供城市数据
 * @author yuhuofei2021
 * @date 2021年10月3日
 */
@RestController
@RequestMapping("/cities")
public class CityController {

	@Resource
	private CityDataService cityDataService;
	
	@GetMapping
	public List<City> listCity() throws Exception {
		return cityDataService.listCity();
	}
}
